package ru.ognick.locale;

import ru.ognick.logic.Praxis.PraxisType;

public abstract class ALocale implements ILocale {
	
	
	public String G_Lang(Lang source)
	{
		switch (source) {
		case RU:
			return G_LANG_RU();
		case EN:
			return G_LANG_EN();
		default:
			return G_LANG_EN();
		}
	}
	
	public Lang G_Lang(String source)
	{
		if (source.equals(G_LANG_RU()))
			return Lang.RU;
		if (source.equals(G_LANG_EN()))
			return Lang.EN;
		
		return Lang.EN;
	}
	
	public String[] langList() {
		Lang[] langs = Lang.values();
		String[] values = new String[langs.length];
		for (int i = 0; i < langs.length; i++)
			values[i] =  G_Lang(langs[i]);
		return values;
	}
	
	public String G_Praxis(PraxisType source) {
		
		switch (source) {
		case action:
				return G_PRAXIS_ACTIVE();
		case passive:
				return G_PRAXIS_PASSIVE();
		default:
				return null;
		}
	}


	public PraxisType G_Praxis(String source) {
		if (source.equals(G_PRAXIS_ACTIVE()))
			return  PraxisType.action;
		else
			return  PraxisType.passive;
	}
}
